home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / Development Tools & Languages / Macintosh Common Lisp Related / interfaces / QuickTime™ 1.5 interfaces / ImageCodec.lisp < prev    next >
Encoding:
Text File  |  1994-09-12  |  8.7 KB  |  246 lines  |  [TEXT/CCL2]

  1.  
  2. (in-package :TRAPS)             ; 
  3. ; Created: Tuesday, October 13, 1992 
  4. ;  ImageCodec.p
  5. ;  Pascal Interface to the Macintosh Libraries
  6. ;  Copyright Apple Computer, Inc. 1991, 1992
  7. ;  All rights reserved
  8.  
  9. ; $IFC UNDEFINED UsingIncludes
  10. ; $SETC UsingIncludes := 0
  11. ; $ENDC
  12.  
  13. ; $IFC NOT UsingIncludes
  14.  
  15. ; $ENDC
  16.  
  17. ; $IFC UNDEFINED UsingImageCodec
  18. ; $SETC UsingImageCodec := 1
  19.  
  20. ; $I+
  21. ; $SETC ImageCodecIncludes := UsingIncludes
  22. ; $SETC UsingIncludes := 1
  23. ; $IFC UNDEFINED UsingQuickDraw
  24.  
  25. (require-interface 'QUICKDRAW)  ; $I $$Shell(PInterfaces)QuickDraw.p
  26. ; $ENDC
  27. ; $IFC UNDEFINED UsingQDOffscreen
  28.  
  29. (require-interface 'QDOFFSCREEN); $I $$Shell(PInterfaces)QDOffscreen.p
  30. ; $ENDC
  31.  
  32. ; $IFC UNDEFINED UsingTypes
  33.  
  34. (require-interface 'TYPES)      ; $I $$Shell(PInterfaces)Types.p
  35. ; $ENDC
  36.  
  37. ; $IFC UNDEFINED UsingComponents
  38.  
  39. (require-interface 'COMPONENTS) ; $I $$Shell(PInterfaces)Components.p
  40. ; $ENDC
  41.  
  42. ; $IFC UNDEFINED UsingImageCompression
  43.  
  44. (require-interface 'IMAGECOMPRESSION); $I $$Shell(PInterfaces)ImageCompression.p
  45. ; $ENDC
  46.  
  47. ; $SETC UsingIncludes := ImageCodecIncludes
  48.  
  49. ;     codec component selectors    
  50. ;     codec selectors 0-127 are reserved by Apple 
  51. ;     codec selectors 128-191 are subtype specific 
  52. ;     codec selectors 192-255 are vendor specific 
  53. ;      codec selectors 256-32767 are reserved by Apple 
  54. ;     negative selectors are reserved by the Component Manager 
  55.  
  56. (defconstant $codecGetCodecInfo #X0)
  57. (defconstant $codecGetCompressionTime #X1)
  58. (defconstant $codecGetMaxCompressionSize #X2)
  59. (defconstant $codecPreCompress #X3)
  60. (defconstant $codecBandCompress #X4)
  61. (defconstant $codecPreDecompress #X5)
  62. (defconstant $codecBandDecompress #X6)
  63. (defconstant $codecCDSequenceBusy #X7)
  64. (defconstant $codecGetCompressedImageSize #X8)
  65. (defconstant $codecGetSimilarity #X9)
  66. (defconstant $codecTrimImage #XA)
  67.  
  68. ;     codec capabilities flags    
  69.  
  70. (defconstant $codecCanScale #X1)
  71. (defconstant $codecCanMask #X2)
  72. (defconstant $codecCanMatte #X4)
  73. (defconstant $codecCanTransform #X8)
  74. (defconstant $codecCanTransferMode #X10)
  75. (defconstant $codecCanCopyPrev #X20)
  76. (defconstant $codecCanSpool #X40)
  77. (defconstant $codecCanClipVertical #X80)
  78. (defconstant $codecCanClipRectangular #X100)
  79. (defconstant $codecCanRemapColor #X200)
  80. (defconstant $codecCanFastDither #X400)
  81. (defconstant $codecCanSrcExtract #X800)
  82. (defconstant $codecCanCopyPrevComp #X1000)
  83. (defconstant $codecCanAsync #X2000)
  84. (defconstant $codecCanMakeMask #X4000)
  85. (defconstant $codecCanShift #X8000)
  86.  
  87. (def-mactype :CODECCAPABILITIESPTR (find-mactype :POINTER))
  88. (defrecord CodecCapabilities 
  89.    (flags :SIGNED-LONG)
  90.    (wantedPixelSize :SIGNED-INTEGER)
  91.    (extendWidth :SIGNED-INTEGER)
  92.    (extendHeight :SIGNED-INTEGER)
  93.    (bandMin :SIGNED-INTEGER)
  94.    (bandInc :SIGNED-INTEGER)
  95.    (pad :SIGNED-INTEGER)
  96.    (time :SIGNED-INTEGER)
  97.    )
  98.  
  99. (defconstant $codecConditionFirstBand #X1)
  100. (defconstant $codecConditionLastBand #X2)
  101. (defconstant $codecConditionFirstFrame #X4)
  102. (defconstant $codecConditionNewDepth #X8)
  103. (defconstant $codecConditionNewTransform #X10)
  104. (defconstant $codecConditionNewSrcRect #X20)
  105. (defconstant $codecConditionNewMask #X40)
  106. (defconstant $codecConditionNewMatte #X80)
  107. (defconstant $codecConditionNewTransferMode #X100)
  108. (defconstant $codecConditionNewClut #X200)
  109. (defconstant $codecConditionNewAccuracy #X400)
  110. (defconstant $codecConditionNewDestination #X800)
  111. (defconstant $codecConditionCodecChangedMask #X80000000)
  112.  
  113. (defconstant $codecInfoResourceType :|cdci|);  codec info resource type 
  114. (defconstant $codecInterfaceVersion 1)
  115.  
  116. (def-mactype :CODECCOMPRESSPARAMSPTR (find-mactype :POINTER))
  117. (defrecord CodecCompressParams 
  118.    (sequenceID :SIGNED-LONG)    ;  precompress,bandcompress 
  119.    (imageDescription (:HANDLE :IMAGEDESCRIPTION));  precompress,bandcompress 
  120.    (data :POINTER)
  121.    (bufferSize :SIGNED-LONG)
  122.    (frameNumber :SIGNED-LONG)
  123.    (startLine :SIGNED-LONG)
  124.    (stopLine :SIGNED-LONG)
  125.    (conditionFlags :SIGNED-LONG)
  126.    (callerFlags :SIGNED-INTEGER)
  127.    (capabilities (:POINTER :CODECCAPABILITIES));  precompress,bandcompress 
  128.    (ProgressProcRecord :PROGRESSPROCRECORD)
  129.    (CompletionProcRecord :COMPLETIONPROCRECORD)
  130.    (FlushProcRecord :FLUSHPROCRECORD)
  131.    (srcPixMap :PIXMAP)          ;  precompress,bandcompress 
  132.    (prevPixMap :PIXMAP)
  133.    (spatialQuality :SIGNED-LONG)
  134.    (temporalQuality :SIGNED-LONG)
  135.    (similarity :SIGNED-LONG)
  136.    (reserved (:ARRAY :SIGNED-LONG 2))
  137.    )
  138.  
  139. (def-mactype :CODECDECOMPRESSPARAMSPTR (find-mactype :POINTER))
  140. (defrecord CodecDecompressParams 
  141.    (sequenceID :SIGNED-LONG)    ;  predecompress,banddecompress 
  142.    (imageDescription (:HANDLE :IMAGEDESCRIPTION));  predecompress,banddecompress 
  143.    (data :POINTER)
  144.    (bufferSize :SIGNED-LONG)
  145.    (frameNumber :SIGNED-LONG)
  146.    (startLine :SIGNED-LONG)
  147.    (stopLine :SIGNED-LONG)
  148.    (conditionFlags :SIGNED-LONG)
  149.    (callerFlags :SIGNED-INTEGER)
  150.    (capabilities (:POINTER :CODECCAPABILITIES));  predecompress,banddecompress 
  151.    (ProgressProcRecord :PROGRESSPROCRECORD)
  152.    (CompletionProcRecord :COMPLETIONPROCRECORD)
  153.    (DataProcRecord :DATAPROCRECORD)
  154.    (port (:POINTER :CGRAFPORT)) ;  predecompress,banddecompress 
  155.    (dstPixMap :PIXMAP)          ;  predecompress,banddecompress 
  156.    (maskBits (:POINTER :BITMAP))
  157.    (mattePixMap (:POINTER :PIXMAP))
  158.    (srcRect :RECT)              ;  predecompress,banddecompress 
  159.    (matrix (:POINTER :MATRIXRECORD));  predecompress,banddecompress 
  160.    (accuracy :SIGNED-LONG)      ;  predecompress,banddecompress 
  161.    (transferMode :SIGNED-INTEGER);  predecompress,banddecompress 
  162.    (reserved (:ARRAY :SIGNED-LONG 2))
  163.    )
  164.  
  165.  
  166. #| Not in ROM
  167. (deftrap _CDGETCODECINFO ((STORAGE :HANDLE) (INFO (:POINTER :CODECINFO)))
  168.    (:STACK :SIGNED-LONG)
  169.    (:STACK-TRAP #x0))
  170. |#
  171. #| Not in ROM
  172. (deftrap _CDGETCOMPRESSIONTIME ((STORAGE :HANDLE) (SRC (:HANDLE :PIXMAP)) (SRCRECT :RECT) (DEPTH :SIGNED-INTEGER) (SPATIALQUALITY (:POINTER :SIGNED-LONG)) (TEMPORALQUALITY (:POINTER :SIGNED-LONG)) (TIME (:POINTER :SIGNED-LONG)))
  173.    (:STACK :SIGNED-LONG)
  174.    (:STACK-TRAP #x0))
  175. |#
  176. #| Not in ROM
  177. (deftrap _CDGETMAXCOMPRESSIONSIZE ((STORAGE :HANDLE) (SRC (:HANDLE :PIXMAP)) (SRCRECT :RECT) (DEPTH :SIGNED-INTEGER) (QUALITY :SIGNED-LONG) (SIZE (:POINTER :SIGNED-LONG)))
  178.    (:STACK :SIGNED-LONG)
  179.    (:STACK-TRAP #x0))
  180. |#
  181. #| Not in ROM
  182. (deftrap _CDPRECOMPRESS ((STORAGE :HANDLE) (PARAMS (:POINTER :CODECCOMPRESSPARAMS)))
  183.    (:STACK :SIGNED-LONG)
  184.    (:STACK-TRAP #x0))
  185. |#
  186. #| Not in ROM
  187. (deftrap _CDBANDCOMPRESS ((STORAGE :HANDLE) (PARAMS (:POINTER :CODECCOMPRESSPARAMS)))
  188.    (:STACK :SIGNED-LONG)
  189.    (:STACK-TRAP #x0))
  190. |#
  191. #| Not in ROM
  192. (deftrap _CDPREDECOMPRESS ((STORAGE :HANDLE) (PARAMS (:POINTER :CODECDECOMPRESSPARAMS)))
  193.    (:STACK :SIGNED-LONG)
  194.    (:STACK-TRAP #x0))
  195. |#
  196. #| Not in ROM
  197. (deftrap _CDBANDDECOMPRESS ((STORAGE :HANDLE) (PARAMS (:POINTER :CODECDECOMPRESSPARAMS)))
  198.    (:STACK :SIGNED-LONG)
  199.    (:STACK-TRAP #x0))
  200. |#
  201. #| Not in ROM
  202. (deftrap _CDCODECBUSY ((STORAGE :HANDLE) (SEQ :SIGNED-LONG))
  203.    (:STACK :SIGNED-LONG)
  204.    (:STACK-TRAP #x0))
  205. |#
  206. #| Not in ROM
  207. (deftrap _CDGETCOMPRESSEDIMAGESIZE ((STORAGE :HANDLE) (DESC (:HANDLE :IMAGEDESCRIPTION)) (DATA :POINTER) (BUFFERSIZE :SIGNED-LONG) (DATAPROC (:POINTER :DATAPROCRECORD)) (DATASIZE (:POINTER :SIGNED-LONG)))
  208.    (:STACK :SIGNED-LONG)
  209.    (:STACK-TRAP #x0))
  210. |#
  211. #| Not in ROM
  212. (deftrap _CDGETSIMILARITY ((STORAGE :HANDLE) (SRC (:HANDLE :PIXMAP)) (SRCRECT :RECT) (DESC (:HANDLE :IMAGEDESCRIPTION)) (DATA :POINTER) (SIMILARITY (:POINTER :SIGNED-LONG)))
  213.    (:STACK :SIGNED-LONG)
  214.    (:STACK-TRAP #x0))
  215. |#
  216. #| Not in ROM
  217. (deftrap _CDTRIMIMAGE ((STORAGE :HANDLE) (DESC (:HANDLE :IMAGEDESCRIPTION)) (INDATA :POINTER) (INBUFFERSIZE :SIGNED-LONG) (DATAPROC (:POINTER :DATAPROCRECORD)) (OUTDATA :POINTER) (OUTBUFFERSIZE :SIGNED-LONG) (FLUSHPROC (:POINTER :FLUSHPROCRECORD)) (TRIMRECT (:POINTER :RECT)) (PROGRESSPROC (:POINTER :PROGRESSPROCRECORD)))
  218.    (:STACK :SIGNED-LONG)
  219.    (:STACK-TRAP #x0))
  220. |#
  221. ; $ENDC
  222.  
  223.  
  224. (export '($CODECINTERFACEVERSION $CODECINFORESOURCETYPE
  225.           $CODECCONDITIONCODECCHANGEDMASK $CODECCONDITIONNEWDESTINATION
  226.           $CODECCONDITIONNEWACCURACY $CODECCONDITIONNEWCLUT
  227.           $CODECCONDITIONNEWTRANSFERMODE $CODECCONDITIONNEWMATTE
  228.           $CODECCONDITIONNEWMASK $CODECCONDITIONNEWSRCRECT
  229.           $CODECCONDITIONNEWTRANSFORM $CODECCONDITIONNEWDEPTH
  230.           $CODECCONDITIONFIRSTFRAME $CODECCONDITIONLASTBAND
  231.           $CODECCONDITIONFIRSTBAND $CODECCANSHIFT $CODECCANMAKEMASK
  232.           $CODECCANASYNC $CODECCANCOPYPREVCOMP $CODECCANSRCEXTRACT
  233.           $CODECCANFASTDITHER $CODECCANREMAPCOLOR $CODECCANCLIPRECTANGULAR
  234.           $CODECCANCLIPVERTICAL $CODECCANSPOOL $CODECCANCOPYPREV
  235.           $CODECCANTRANSFERMODE $CODECCANTRANSFORM $CODECCANMATTE $CODECCANMASK
  236.           $CODECCANSCALE $CODECTRIMIMAGE $CODECGETSIMILARITY
  237.           $CODECGETCOMPRESSEDIMAGESIZE $CODECCDSEQUENCEBUSY
  238.           $CODECBANDDECOMPRESS $CODECPREDECOMPRESS $CODECBANDCOMPRESS
  239.           $CODECPRECOMPRESS $CODECGETMAXCOMPRESSIONSIZE
  240.           $CODECGETCOMPRESSIONTIME $CODECGETCODECINFO))
  241. (provide-interface 'ImageCodec)